The _ssss_ssss_dddd_iiii______gggg_eeee_tttt______cccc_oooo_nnnn_ffff_iiii_gggg______aaaa_nnnn_dddd______llll_oooo_aaaa_dddd function provides the means for an
application to load the dynamic shared object (DSO) corresponding to a
source for a given system database. A _dddd_aaaa_tttt_aaaa_bbbb_aaaa_ssss_eeee is a collection of
information related to users, groups, networks, etc. that the operating
system expects to be maintained by user-level libraries. For example,
information relating to users is encapsulated by the _pppp_aaaa_ssss_ssss_wwww_dddd database.
Each such has a definite _iiii_nnnn_tttt_eeee_rrrr_ffff_aaaa_cccc_eeee. For example, the ggggeeeettttppppwwwweeeennnntttt((((3333CCCC))))
routines define the interface for the passwd database. The information
contained in a given database may be stored in multiple _ssss_oooo_uuuu_rrrr_cccc_eeee_ssss. Almost
all standard databases come with sources that are _cccc_oooo_mmmm_pppp_iiii_llll_eeee_dddd_----_iiii_nnnn with the
interface. The _ffff_iiii_llll_eeee_ssss source for the passwd database which maintains
relevant information in files is one such. A _DDDD_yyyy_nnnn_aaaa_mmmm_iiii_cccc source for a
database is one whose implementation is not fixed at the time of
compilation of interface for the database. Thus, a dynamic source allows
for custom implementations of database repositories.
The file ////eeeettttcccc////ssssssssddddiiii....ccccoooonnnnffff (see _ssss_ssss_dddd_iiii(4)) is used to add a dynamic source for
a database. Each application can cache configuration information for a
given database using a variable of type _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_ssss_dddd_iiii_cccc_oooo_nnnn_ffff_iiii_gggg_iiii_nnnn_ffff_oooo, which
includes the following members:
_iiii_nnnn_tttt _ssss_ssss_dddd_iiii______cccc_iiii______gggg_oooo_tttt______cccc_oooo_nnnn_ffff_iiii_gggg If non-zero, the rest of the fields
_cccc_hhhh_aaaa_rrrr _****_****_ssss_ssss_dddd_iiii______cccc_iiii______cccc_uuuu_rrrr_rrrr_dddd_ssss_rrrr_cccc Next dynamic source to load. Pointer to
the name in the above array.
Initially, the variable used to cache configuration information should be
set to ______SSSS_SSSS_DDDD_IIII______IIII_nnnn_iiii_tttt_CCCC_oooo_nnnn_ffff_iiii_gggg_IIII_nnnn_ffff_oooo.
Each dynamic source should be implemented as a DSO, and should reside in
a standard directory as defined by ______SSSS_SSSS_DDDD_IIII______SSSS_TTTT_DDDD______SSSS_RRRR_CCCC______DDDD_IIII_RRRR. The DSO should
export a variable which represents a vector of functions. This vector
contains addresses of functions which implement corresponding
functionality of the database interface. The correspondence between the
vector and the routines of the database interface is defined in a
database specific header file, _<<<<_dddd_iiii_____{_d_a_t_a_b_a_s_e-_n_a_m_e}_...._hhhh_>>>>. For example, the
file _<<<<_dddd_iiii______gggg_rrrr_oooo_uuuu_pppp_...._hhhh_>>>> defines the correspondence for the _gggg_rrrr_oooo_uuuu_pppp database. If a
source does not implement a particular routine then the corresponding
element in the vector should be set to _NNNN_UUUU_LLLL_LLLL.
On its very first invocation, _ssss_ssss_dddd_iiii______gggg_eeee_tttt______cccc_oooo_nnnn_ffff_iiii_gggg______aaaa_nnnn_dddd______llll_oooo_aaaa_dddd function gathers
information for the database _dddd_bbbb_nnnn_aaaa_mmmm_eeee from the configuration file, and
caches it in the variable pointed to by _cccc_ffff_iiii_nnnn_ffff_oooo. Then, it loads (using
_d_l_o_p_e_n(3)) the DSO corresponding to the first source listed in the
configuration. Information concerning the loaded source is returned in
_ssss_rrrr_cccc_iiii_nnnn_ffff_oooo, which is of type _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_ssss_dddd_iiii_ssss_rrrr_cccc_iiii_nnnn_ffff_oooo, and has the following
______SSSS_SSSS_DDDD_IIII______VVVV_OOOO_IIII_DDDD_FFFF_UUUU_NNNN_CCCC _****_ssss_ssss_dddd_iiii______ssss_iiii______ffff_uuuu_nnnn_cccc_ssss A pointer to the vector of routines
implemented by the source; resolved
using _d_l_s_y_m(3) from the DSO
corresponding to the source.
On subsequent invocations (with the same arguments),
_ssss_ssss_dddd_iiii______gggg_eeee_tttt______cccc_oooo_nnnn_ffff_iiii_gggg______aaaa_nnnn_dddd______llll_oooo_aaaa_dddd loads the next source in the cached
configuration information; _ssss_rrrr_cccc_iiii_nnnn_ffff_oooo is overwritten with data from this new
source. Since _ssss_ssss_dddd_iiii______gggg_eeee_tttt______cccc_oooo_nnnn_ffff_iiii_gggg______aaaa_nnnn_dddd______llll_oooo_aaaa_dddd maintains state between
invocations in _cccc_ffff_iiii_nnnn_ffff_oooo, it should not be manipulated by the caller, except
for proper initialization before the first invocation.
If a source was successfully loaded, _ssss_ssss_dddd_iiii______gggg_eeee_tttt______cccc_oooo_nnnn_ffff_iiii_gggg______aaaa_nnnn_dddd______llll_oooo_aaaa_dddd returns